package com.king.config

import java.util.Properties

/**
 * @Author: KingWang
 * @Date: 2021/11/23  
 * @Desc:
 **/

case class DB(dbname:String,url:String,prop:Properties)

object DBConstant {

  //AI_BI
  def mysql_ai_bi():DB = {
    val url = "jdbc:mysql://172.20.80.190:3306/AI_BI?characterEncoding=UTF-8&useSSL=false"
    val prop = new Properties()
    prop.setProperty("url",url)
    prop.setProperty("driver","com.mysql.jdbc.Driver")
    prop.setProperty("user","xinyan_ai_bi")
    prop.setProperty("password","l5J7JLk878G95WdQ")
    DB("AI_BI",url,prop)
  }

  //test
  def mysql_test:DB = {
    val url = "jdbc:mysql://hadoop200:3306/test?characterEncoding=UTF-8&useSSL=false"
    val prop = new Properties()
    prop.setProperty("url",url)
    prop.setProperty("driver","com.mysql.jdbc.Driver")
    prop.setProperty("user","root")
    prop.setProperty("password","root")
    DB("test",url,prop)
  }

  //gmall-210325-realtime
  def mysql_gmall_210325_realtime():DB = {
    val url = "jdbc:mysql://hadoop200:3306/gmall-210325-realtime?characterEncoding=UTF-8&useSSL=false"
    val prop = new Properties()
    prop.setProperty("url",url)
    prop.setProperty("driver","com.mysql.jdbc.Driver")
    prop.setProperty("user","root")
    prop.setProperty("password","root")
    DB("test",url,prop)
  }



}


